package com.qall.util;

import com.alibaba.dubbo.common.utils.NetUtils;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class MachineInfoUtil {
    public static String localIp;
    public static String javaVersion;
    public static String  osName;
    private static String osArch;
    private static String osVersion;


    static {
        localIp = getLocalIp();
    }

    public static String getLocalIp() {
        String address = "localhost";
        try {
            InetAddress addr = InetAddress.getLocalHost();
            address = addr.getHostAddress();
        } catch (UnknownHostException e) {
            e.printStackTrace();
            address = NetUtils.getLocalHost();
        }
        return address;
    }



}
